<%@ page contentType="text/html; charset=utf-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="basePath" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html>
<html>

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>权限管理系统</title>

    <link href="${basePath}/resources/zheng-ui/css/bootstrap.min.css" rel="stylesheet">
    <link href="${basePath}/resources/zheng-ui/font-awesome/css/font-awesome.css" rel="stylesheet">
    <link href="${basePath}/resources/zheng-ui/css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css"
          rel="stylesheet">
    <link href="${basePath}/resources/zheng-ui/css/animate.css" rel="stylesheet">
    <link href="${basePath}/resources/zheng-ui/css/style.css" rel="stylesheet">
    <!-- multitabs -->
    <link href="${basePath}/resources/zheng-ui/css/plugins/bootstrap-multitabs/bootstrap-multitabs.css"
          rel="stylesheet">
    <link href="${basePath}/resources/zheng-ui/css/plugins/material-design-iconic-font-2.2.0/css/material-design-iconic-font.min.css"
          rel="stylesheet"/>

</head>

<body class="md-skin fixed-nav no-skin-config">

<div id="wrapper">

    <nav class="navbar-default navbar-static-side" role="navigation">
        <div class="sidebar-collapse">
            <ul class="nav metismenu" id="side-menu">
                <li class="nav-header">
                    <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="${basePath}${upmsUser.avatar}"/>
                             </span>
                        <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                            <span class="clear"> <span class="block m-t-xs"> <strong
                                    class="font-bold">${upmsUser.realname}</strong>
                             </span> <span class="text-muted text-xs block">Art Director <b
                                    class="caret"></b></span> </span> </a>
                        <ul class="dropdown-menu animated fadeInRight m-t-xs">
                            <li><a href="profile.html">Profile</a></li>
                            <li><a href="contacts.html">Contacts</a></li>
                            <li><a href="mailbox.html">Mailbox</a></li>
                            <li class="divider"></li>
                            <li><a href="login.html">Logout</a></li>
                        </ul>
                    </div>
                    <div class="logo-element">
                        IN+
                    </div>
                </li>

                <c:forEach var="upmsPermission" items="${upmsPermissions}" varStatus="status">
                    <c:if test="${upmsPermission.pid == 0}">
                        <li class="system_menus system_${upmsPermission.systemId}"
                            <c:if test="${upmsPermission.systemId != 1}">style="display:none;"</c:if>>
                            <a href="#"><i class="fa fa-files-o ${upmsPermission.icon}"></i> <span
                                    class="nav-label">${upmsPermission.name}</span><span class="fa arrow"></span></a>
                            <ul class="nav nav-second-level collapse">
                                <c:forEach var="subUpmsPermission" items="${upmsPermissions}">
                                    <c:if test="${subUpmsPermission.pid == upmsPermission.permissionId}">
                                        <c:forEach var="upmsSystem" items="${upmsSystems}">
                                            <c:if test="${subUpmsPermission.systemId == upmsSystem.systemId}">
                                                <c:set var="systemBasePath" value="${upmsSystem.basepath}"/></c:if>
                                        </c:forEach>
                                        <li><a class="menuItem" data-id="${subUpmsPermission.permissionId}"
                                               href="${systemBasePath}${subUpmsPermission.uri}">${subUpmsPermission.name}<span
                                                class="label label-info pull-right">62</span></a></li>
                                    </c:if>
                                </c:forEach>
                            </ul>
                        </li>
                    </c:if>
                </c:forEach>

                <li class="landing_link">
                    <a target="_blank" href="landing.html"><i class="fa fa-star"></i> <span class="nav-label">Landing Page</span>
                        <span class="label label-warning pull-right">NEW</span></a>
                </li>
            </ul>

        </div>
    </nav>

    <div id="page-wrapper" class="gray-bg">
        <div class="row border-bottom">
            <nav class="navbar navbar-fixed-top" role="navigation" style="margin-bottom: 0">
                <div class="navbar-header">
                    <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i>
                    </a>
                    <form role="search" class="navbar-form-custom" action="search_results.html">
                        <div class="form-group">
                            <input type="text" placeholder="Search for something..." class="form-control"
                                   name="top-search" id="top-search">
                        </div>
                    </form>
                </div>
                <ul class="nav navbar-top-links navbar-right">
                    <li>
                        <span class="m-r-sm text-muted welcome-message">Welcome to INSPINIA+ Admin Theme.</span>
                    </li>
                    <li class="dropdown">
                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                            <i class="fa fa-envelope"></i> <span class="label label-warning">16</span>
                        </a>
                        <ul class="dropdown-menu dropdown-messages">
                            <li>
                                <div class="dropdown-messages-box">
                                    <a href="profile.html" class="pull-left">
                                        <img alt="image" class="img-circle" src="${basePath}${upmsUser.avatar}">
                                    </a>
                                    <div class="media-body">
                                        <small class="pull-right">46h ago</small>
                                        <strong>Mike Loreipsum</strong> started following <strong>Monica Smith</strong>.
                                        <br>
                                        <small class="text-muted">3 days ago at 7:58 pm - 10.06.2014</small>
                                    </div>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="dropdown-messages-box">
                                    <a href="profile.html" class="pull-left">
                                        <img alt="image" class="img-circle" src="${basePath}${upmsUser.avatar}">
                                    </a>
                                    <div class="media-body ">
                                        <small class="pull-right text-navy">5h ago</small>
                                        <strong>Chris Johnatan Overtunk</strong> started following <strong>Monica
                                        Smith</strong>. <br>
                                        <small class="text-muted">Yesterday 1:21 pm - 11.06.2014</small>
                                    </div>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="dropdown-messages-box">
                                    <a href="profile.html" class="pull-left">
                                        <img alt="image" class="img-circle" src="${basePath}${upmsUser.avatar}">
                                    </a>
                                    <div class="media-body ">
                                        <small class="pull-right">23h ago</small>
                                        <strong>Monica Smith</strong> love <strong>Kim Smith</strong>. <br>
                                        <small class="text-muted">2 days ago at 2:30 am - 11.06.2014</small>
                                    </div>
                                </div>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="text-center link-block">
                                    <a href="mailbox.html">
                                        <i class="fa fa-envelope"></i> <strong>Read All Messages</strong>
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </li>
                    <li class="dropdown">
                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                            <i class="fa fa-bell"></i> <span class="label label-primary">8</span>
                        </a>
                        <ul class="dropdown-menu dropdown-alerts">
                            <li>
                                <a href="mailbox.html">
                                    <div>
                                        <i class="fa fa-envelope fa-fw"></i> You have 16 messages
                                        <span class="pull-right text-muted small">4 minutes ago</span>
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <a href="profile.html">
                                    <div>
                                        <i class="fa fa-twitter fa-fw"></i> 3 New Followers
                                        <span class="pull-right text-muted small">12 minutes ago</span>
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <a href="grid_options.html">
                                    <div>
                                        <i class="fa fa-upload fa-fw"></i> Server Rebooted
                                        <span class="pull-right text-muted small">4 minutes ago</span>
                                    </div>
                                </a>
                            </li>
                            <li class="divider"></li>
                            <li>
                                <div class="text-center link-block">
                                    <a href="notifications.html">
                                        <strong>See All Alerts</strong>
                                        <i class="fa fa-angle-right"></i>
                                    </a>
                                </div>
                            </li>
                        </ul>
                    </li>


                    <li>
                        <a href="${basePath}/sso/logout">
                            <i class="fa fa-sign-out"></i> Log out
                        </a>
                    </li>


                    <li class="dropdown">
                        <a class="dropdown-toggle count-info" data-toggle="dropdown" href="#">
                            <i class="fa fa-tasks"></i>
                        </a>
                        <ul class="dropdown-menu dropdown-alerts">

                            <c:forEach var="upmsSystem" items="${upmsSystems}" varStatus="status">

                                <li>
                                    <a href="javascript:;" class="switch-systems" systemid="${upmsSystem.systemId}"
                                       systemname="${upmsSystem.name}" systemtitle="${upmsSystem.title}">
                                        <div>
                                            <i class="${upmsSystem.icon}"></i> ${upmsSystem.title}
                                            <span class="pull-right text-muted small"></span>
                                        </div>
                                    </a>
                                </li>

                            </c:forEach>

                        </ul>
                    </li>
                </ul>

            </nav>
        </div>
        <div class="content-tabs">
            <button class="roll-nav roll-left tabLeft">
                <i class="fa fa-backward"></i>
            </button>
            <nav class="page-tabs menuTabs">
                <div class="page-tabs-content" style="margin-left: 0px;">
                    <a href="javascript:;" class="menuTab" data-id="/manage/system/index">欢迎首页</a>
                    <a href="javascript:;" class="active menuTab" data-id="/manage/organization/index">机构管理<i
                            class="fa fa-remove"></i>
                    </a>
                </div>
            </nav>
            <button class="roll-nav roll-right tabRight">
                <i class="fa fa-forward" style="margin-left: 3px;"></i>
            </button>
            <div class="btn-group roll-nav roll-right">
                <button class="dropdown tabClose" data-toggle="dropdown">
                    页签操作<i class="fa fa-caret-down" style="padding-left: 3px;"></i>
                </button>
                <ul class="dropdown-menu dropdown-menu-right">
                    <li><a class="tabReload" href="javascript:void();">刷新当前</a></li>
                    <li><a class="tabCloseCurrent" href="javascript:void();">关闭当前</a></li>
                    <li><a class="tabCloseAll" href="javascript:void();">全部关闭</a></li>
                    <li><a class="tabCloseOther" href="javascript:void();">除此之外全部关闭</a></li>
                </ul>
            </div>
            <button class="roll-nav roll-right fullscreen">
                <i class="fa fa-arrows-alt"></i>
            </button>
        </div>

        <div class="wrapper-content animated fadeInRight">
            <div class="content-iframe" style="overflow: hidden;">
                <div class="mainContent" id="content-main"
                     style="margin:0 4px 0 0; padding: 0px;">
                    <iframe class="NFine_iframe" width="100%" height="100%"
                            frameborder="0"
                            data-id="33"
                            src="/manage/system/index"
                            style="display: none;"></iframe>
                    <iframe class="NFine_iframe"
                            id="iframe252229DB-35CA-47AE-BDAE-C9903ED5BA7B"
                            name="iframe252229DB-35CA-47AE-BDAE-C9903ED5BA7B"
                            width="100%" height="100%"
                            frameborder="0"
                            data-id="/manage/system/index"
                            src="/manage/system/index" seamless></iframe>
                </div>
            </div>

        </div>
        <div class="footer">
            <div class="pull-right">
                10GB of <strong>250GB</strong> Free.
            </div>
            <div>
                <strong>Copyright</strong> Example Company &copy; 2014-2017
            </div>
        </div>

    </div>
</div>


<!-- Mainly scripts -->
<script src="${basePath}/resources/zheng-ui/js/jquery-3.1.1.min.js"></script>
<script src="${basePath}/resources/zheng-ui/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/zheng-ui/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="${basePath}/resources/zheng-ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- Custom and plugin javascript -->
<script src="${basePath}/resources/zheng-ui/js/inspinia.js"></script>
<script src="${basePath}/resources/zheng-ui/js/plugins/pace/pace.min.js"></script>

<script src="${basePath}/resources/zheng-ui/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>

<!-- multitabs -->
<script src="${basePath}/resources/zheng-ui/js/plugins/bootstrap-multitabs/js/multitabs.js"></script>

<script type="application/javascript">
    // 系统切换
    $('.switch-systems').click(function () {
        var systemid = $(this).attr('systemid');
        var systemname = $(this).attr('systemname');
        var systemtitle = $(this).attr('systemtitle');
        $('.system_menus').hide(0, function () {
            $('.system_' + systemid).show();
        });
    });
</script>
</body>

</html>
